<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
</head>
<body>

</body>
<script src="./index.js"></script>
<script>
	const p1 = new Promise(function(resolve,reject){
		setTimeout(function(){
			resolve(100);
		},1000)
		
	});
	const p2 = new Promise(function(resolve,reject){
		setTimeout(function(){
			reject(200);
		},500)
	});
	const p3 = new Promise(function(resolve,reject){
		setTimeout(function(){
			reject(300);
		},2000)
	});
	const p4 = new Promise(function(resolve,reject){
		setTimeout(function(){
			resolve(400);
		},1000)
	});
	Promise.all([p1,p2,p3,p4]).then(value=>{
		console.log(value);// [100,200,300,400]
	},reason=>{
		console.log("失败",reason);
	})
</script>

</html>